#define _CRT_SECURE_NO_WARNINGS
#pragma warning(disable:6031)

#include <stdio.h>
#include <stdlib.h>

int main()
{
	char ch = 0;
	FILE* in = fopen("data.txt", "r");
	FILE* out = fopen("data_copy.txt", "w");
	if ((in == NULL) || (out == NULL))
	{
		perror("in or out");
		exit(EXIT_FAILURE);
	}

	while ((ch = fgetc(in)) != EOF)
	{
		fputc(ch, out);
	}

	fclose(in);
	fclose(out);

	return 0;
}